Add per-GM event scoping to the channel templates (consume assigned_gm)#32
Open
kylecarbonneau wants to merge 1 commit into
Open
Conversation
Consume ty's new assigned_gm field (TASK_ASSIGNED_GM env var, shipped in
bborn/taskyou PR #561) so a single TaskYou daemon shared by multiple GMs
can scope task events per GM.
Channel template (templates/channel/taskyou-channel.ts.tmpl):
- Add GM_SLUG (process.env.GM_SLUG || GM_ALIAS, defaulting to the
setup-time {{GM_ALIAS}}) and SEE_UNASSIGNED (default true) consts.
- Auto-inject `--assigned-gm <GM_SLUG>` on `ty create` only, idempotent
(skipped if the caller already passed --assigned-gm).
- Filter emitted notifications: emit when assigned_gm === GM_SLUG, or when
unassigned (missing/blank) and SEE_UNASSIGNED. Malformed lines are treated
as unassigned. The line cursor always advances; only the emit is gated.
- Surface assigned_gm in the notification meta.
Hook templates (task.completed, task.blocked):
- Emit assigned_gm (from $TASK_ASSIGNED_GM) in the JSON line.
config.example.env:
- Document GM_SLUG (derives from GM_ALIAS) and SEE_UNASSIGNED.
Additive only; existing behavior — including the SSH/remote path — is
unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the TaskYou Claude Code channel multi-GM aware, consuming the new
assigned_gmfield shipped in bborn/taskyou#561 (thetybinary now setsTASK_ASSIGNED_GMon event hooks and accepts--assigned-gmonty create).What
When several GMs share a single TaskYou daemon, the channel now:
--assigned-gm <GM_SLUG>— only onty create, idempotent (skipped when the caller already passed--assigned-gm).assigned_gmmatches this GM's slug, or when it's unassigned and the GM opts into seeing unassigned events (SEE_UNASSIGNED, defaulttrue).Files (additive — no deletions):
templates/channel/taskyou-channel.ts.tmpl— newGM_SLUG(process.env.GM_SLUG || process.env.GM_ALIAS || {{GM_ALIAS}}) andSEE_UNASSIGNEDconsts;--assigned-gmauto-injection onty create(idempotent); notification filter inpollNotifications(the line cursor always advances — only the emit is gated, so nothing is lost from the read position);assigned_gmadded to the emitted notification meta.templates/hooks/task.completed.tmpl,templates/hooks/task.blocked.tmpl— emit"assigned_gm": "$TASK_ASSIGNED_GM"in the JSON line.config.example.env— documentsGM_SLUG(derives fromGM_ALIAS) andSEE_UNASSIGNED.Why
Channel-side companion to #561: it turns the daemon's per-task GM attribution into actual per-session event routing, so one shared daemon fans tasks/notifications out to the correct GM instead of broadcasting every event to every GM.
Additive on top of #28 (the channels integration) and independent of the local-mode/macOS work (#31) — branched directly off #28 so it's cleanly mergeable on its own (verified zero-conflict merge with #31 in either order). Fully backward-compatible: with no config and an older
ty(noassigned_gm),SEE_UNASSIGNEDdefaults totrue, so unassigned events still surface and tasks are stamped with the GM's existing alias. The SSH/remote command path is untouched.How tested
GM_ALIAS=acme);GM_SLUGsubstitutes to the alias default.bun buildclean (transpile + full bundle against the MCP SDK).bash -nclean; renderedtask.completedwithTASK_ASSIGNED_GMset and a quote-containing title emits valid, correctly-escaped JSON withassigned_gmpopulated.